
clear all 

use "../../final_w1w2.dta"

log using "TablsA7A8", text replace

**Feeling Thermo Models 

encode country, gen(country_cat)

*Average (all but US) 

egen ft_avg_all = rowmean(ft_mexico ft_china ft_UK ft_germ ft_japan ft_PR)


*Ethnocentrism FT 

egen ft_ethno = rowmean(ft_china ft_mexico ft_UK ft_germ ft_japan ft_PR)
replace ft_ethno = ft_ethno/100
replace ft_ethno = 1-abs(ft_ethno)

*PR FT 

gen ft_ethno_PR = ft_us - ft_PR
replace ft_ethno_PR=ft_ethno_PR/100


*Models Reported in online appendix -- Table A7

reg profile_chose b4.country_cat##c.ft_ethno c.mark_up i.rating_cat ///
i.pid3_lean, cluster(id)
est store m1

reg profile_chose b4.country_cat##c.ft_ethno_PR c.mark_up i.rating_cat ///
i.pid3_lean, cluster(id)
est store m2

esttab m1 m2 using TableA7.csv, ///
se r2 nobaselevels obslast nonumber varwidth(16) nogap replace 


**MWTP

*create TableA8

file open TableA8 using TableA8.txt, write replace

file write TableA8 "Measure   " _tab "Country    " _tab    "Ethno" _tab    "   MTWP (95%CI)" _n


*FT Approach 

est restore m1
sum ft_ethno, d

*China
nlcom (_b[2.country]+(_b[2.country#c.ft_ethno]*.205))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "China        " _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[2.country]+(_b[2.country#c.ft_ethno]*.43))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "China        " _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[2.country]+(_b[2.country#c.ft_ethno]*.7))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "China        " _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n




*German  
nlcom (_b[3.country]+(_b[3.country#c.ft_ethno]*.205))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Germany      " _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[3.country]+(_b[3.country#c.ft_ethno]*.43))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Germany      " _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[3.country]+(_b[3.country#c.ft_ethno]*.7))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Germany      " _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n



*Other Country 

nlcom (_b[1.country]+(_b[1.country#c.ft_ethno]*.205))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Outside U.S." _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[1.country]+(_b[1.country#c.ft_ethno]*.43))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Outside U.S." _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[1.country]+(_b[1.country#c.ft_ethno]*.7))/_b[mark_up]
file write TableA8  %9s "Avg FT    " _tab "Outside U.S." _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n



*FT - PR Approach 
est restore m2
sum ft_ethno_PR,d


*China
nlcom (_b[2.country]+(_b[2.country#c.ft_ethno_PR]*-.11))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "China        " _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[2.country]+(_b[2.country#c.ft_ethno_PR]*.14))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "China        " _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n


nlcom (_b[2.country]+(_b[2.country#c.ft_ethno_PR]*.58))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "China        " _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n


*Germany 
nlcom (_b[3.country]+(_b[3.country#c.ft_ethno_PR]*-.11))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Germany      " _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[3.country]+(_b[3.country#c.ft_ethno_PR]*.14))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Germany      " _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n


nlcom (_b[3.country]+(_b[3.country#c.ft_ethno_PR]*.58))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Germany      " _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n



*Other Country 
nlcom (_b[1.country]+(_b[1.country#c.ft_ethno_PR]*-.11))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Outside U.S." _tab   "Low  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n

nlcom (_b[1.country]+(_b[1.country#c.ft_ethno_PR]*.14))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Outside U.S." _tab   "Med  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n


nlcom (_b[1.country]+(_b[1.country#c.ft_ethno_PR]*.58))/_b[mark_up]
file write TableA8  %9s "US-PR FT" _tab "Outside U.S." _tab   "High  " _tab %7.2f (r(b)[1,1]) " ("  %7.2f (  r(b)[1,1] - (1.96*sqrt(r(V)[1,1]))   )  "," %7.2f (  r(b)[1,1] + (1.96*sqrt(r(V)[1,1]))   )    ")"  _n



file close TableA8

log close




















